fix(flaky): propagate auth trigger errors#217
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR updates the ChangesAuth failure propagation in test flaky
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant runFlaky
participant triggerRerun
participant isFlakyFatalTriggerError
runFlaky->>triggerRerun: POST runs/rerun
triggerRerun-->>runFlaky: throws ApiError(code)
runFlaky->>isFlakyFatalTriggerError: check code
alt AUTH_REQUIRED/AUTH_INVALID/AUTH_FORBIDDEN
isFlakyFatalTriggerError-->>runFlaky: fatal=true
runFlaky-->>runFlaky: re-throw ApiError, exitCode=3
else other error
isFlakyFatalTriggerError-->>runFlaky: fatal=false
runFlaky-->>runFlaky: record non-fatal attempt
end
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
zeshi-du
left a comment
There was a problem hiding this comment.
Confirmed the bug is live on main (every trigger error including auth is scored as a flaky attempt), and the fix rethrows AUTH_* before scoring — exit 3, empty stdout, zero recorded attempts, with the flaky-cap and cli-source trigger call untouched. Thanks @JerryNee!
What does this PR do?
Replaces accidentally closed PR #200.
Updates
test flakyso auth failures while triggering reruns are treated as fatal API errors instead of being recorded as ordinary flaky attempts.Specifically, this propagates these trigger-time auth errors:
AUTH_REQUIREDAUTH_INVALIDAUTH_FORBIDDENThat keeps the CLI from reporting an auth/environment failure as a flaky test signal.
Related issue
Fixes #199
Type of change
Testing
Previously validated on the original PR branch with:
npm test -- src/commands/test.flaky.spec.tsnpm run typechecknpm run format:checknpm run lintNO_COLOR= npm testNotes for reviewers
Focused change in
runFlaky: auth-related rerun trigger errors are rethrown, while normal per-attempt flaky recording remains unchanged.Summary by CodeRabbit